/* #include <cstddef>
#include <cstdio>
#include <iostream>
#define lld long long
#define endl "\n"
const int N = 1e5 + 9;
using std::cin;
using std::cout;

int n, m;
lld S[N], P[N];
lld add[N];
lld diff[N];
void cal_diff(const int& l, const int& r, const int& d) {
//void cal_diff(const int& l, int r, int d) {
  diff[l] += d;
  if (r + 1 <= n)
    diff[r + 1] -= d;
}
void input_num() {
  std::cin >> n >> m;
  for (size_t i = 1; i <= n; ++i) {
    cin >> P[i], add[i] = 0;
    if (i == 1)
      diff[i] = P[1];
    else
      diff[i] = P[i] - P[i - 1];
  }

  for (size_t i = 1; i <= m; ++i) {
    int l, r, d;
    cin >> l >> r >> d;
    if (l <= r and l <= n and r <= n)
      cal_diff(l, r, d);
  }
  // cal P[i] = a[i]_new
  for (size_t i = 1; i <= n; ++i) {
    P[i] = P[i - 1] + diff[i];
  }

  for (size_t i = 1; i <= n; ++i) {
    S[i] = S[i - 1] + P[i];
  }
  for (size_t i = 1; i <= n; ++i) {
    cout << S[i] << " ";
  }
}

int main() {
  input_num();
  return 0;
} */

#include <cstddef>
#include <iostream>
#define lld long long
#define endl "\n"
const int N = 1e5 + 9;
using std::cin;
using std::cout;

int n, m;
lld sum[N << 2];
lld lazy[N << 2];
lld S[N];

void build(int node, int l, int r, lld *arr) {
  lazy[node] = 0;
  if (l == r) {
    sum[node] = arr[l];
    return;
  }
  int mid = (l + r) >> 1;
  build(node << 1, l, mid, arr);
  build(node << 1 | 1, mid + 1, r, arr);
  sum[node] = sum[node << 1] + sum[node << 1 | 1];
}

void pushdown(int node, int l, int r) {
  if (lazy[node] == 0)
    return;
  int mid = (l + r) >> 1;
  sum[node << 1] += lazy[node] * (mid - l + 1);
  sum[node << 1 | 1] += lazy[node] * (r - mid);
  lazy[node << 1] += lazy[node];
  lazy[node << 1 | 1] += lazy[node];
  lazy[node] = 0;
}

void update(int node, int l, int r, int ul, int ur, lld d) {
  if (ul <= l && r <= ur) {
    sum[node] += d * (r - l + 1);
    lazy[node] += d;
    return;
  }
  pushdown(node, l, r);
  int mid = (l + r) >> 1;
  if (ul <= mid)
    update(node << 1, l, mid, ul, ur, d);
  if (ur > mid)
    update(node << 1 | 1, mid + 1, r, ul, ur, d);
  sum[node] = sum[node << 1] + sum[node << 1 | 1];
}

// 获取最终序列
void get_array(int node, int l, int r, lld *arr) {
  if (l == r) {
    arr[l] = sum[node];
    return;
  }
  pushdown(node, l, r);
  int mid = (l + r) >> 1;
  get_array(node << 1, l, mid, arr);
  get_array(node << 1 | 1, mid + 1, r, arr);
}

void solve() {
  cin >> n >> m;
  lld initial[N];
  for (int i = 1; i <= n; i++) {
    cin >> initial[i];
  }
  build(1, 1, n, initial);

  for (int i = 1; i <= m; i++) {
    int l, r;
    lld d;
    cin >> l >> r >> d;
    if (l <= r && l <= n && r <= n) {
      update(1, 1, n, l, r, d);
    }
  }

  lld a[N] = {0};
  get_array(1, 1, n, a);

  S[0] = 0;
  for (int i = 1; i <= n; i++) {
    S[i] = S[i - 1] + a[i];
  }

  for (int i = 1; i <= n; i++) {
    cout << S[i] << " ";
  }
}

int main() {
  solve();
  return 0;
}